<?php
if (! defined ( 'DIR_SEP' )) {
	define ( 'DIR_SEP', DIRECTORY_SEPARATOR );
}
define ( 'MID_ROOT', dirname ( __FILE__ ) . DIR_SEP );
if (! defined ( 'APP_ROOT' )) {
	exit ( 'APP_ROOT is not defined! Please set it and retry' );
}
define ( 'BASE_PATH', str_replace ( substr ( strrchr ( $_SERVER ['SCRIPT_NAME'], '/' ), 1 ), '', $_SERVER ['SCRIPT_NAME'] ) );
define ( 'APP_URL', 'http://' . $_SERVER ['HTTP_HOST'] . str_replace ( DIR_SEP, '/', BASE_PATH ) );

list ( $usec, $sec ) = explode ( " ", microtime () );
$time_start = ( float ) $usec + ( float ) $sec;
$timestamp = time ();

require_once MID_ROOT . 'core/mid.php';
Mid::loadClass ( 'config' );
Mid::loadFunc ( 'mid' );
?>